package Day14;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SearchPanel extends JPanel implements ActionListener {
    private ATM05 atm05;
    private JLabel searchLabel = new JLabel("输入名字");
    private JTextField searchField = new JFormattedTextField();
    private JButton suerBtn = new JButton(new ImageIcon("Image/buttonSure.jpg"));
    private JButton cancelBtn = new JButton(new ImageIcon("Image/buttonOff.jpg"));
    private Font font = new Font("宋体",Font.BOLD,20);
    public SearchPanel(ATM05 atm05){
        this.atm05 = atm05;
        this.setLayout(null);
        this.setOpaque(false);

        searchLabel.setBounds(300,200,80,50);
        searchLabel.setFont(font);
        this.add(searchLabel);

        searchField.setBounds(380,200,250,50);
        searchField.setFont(font);
        this.add(searchField);

        suerBtn.setBounds(350,320,140,50);
        this.add(suerBtn);

        cancelBtn.setBounds(500,320,140,50);
        cancelBtn.addActionListener(this);
        this.add(cancelBtn);




    }
    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }
}
